﻿@model Olemas.Models.Book
@{
    ViewBag.Title = "Õpiku info";
    ViewBag.CurrentPage = "homePage"; 
}
@section AddToHead{
    <script type="text/javascript" src="~/Scripts/Shared/jquery.lightbox-0.5.min.js"></script>
    <link type="text/css" href="~/Content/jquery.lightbox-0.5.css" rel="stylesheet"/>
}

<div id="detailsPanel" class="detailsPanel">

    <div id="headingsDiv" class="headingsDiv">
        @Html.Label("Pealkiri: ")
        @Html.Label("Autor: ")
        @Html.Label("Õppekava: ")
        @Html.Label("Asukoht: ")
        @Html.Label("Lisatud: ")
        @Html.Label("Hinnasoov: ")
        @Html.Label("Omanik: ")
        @Html.Label("E-mail: ")
        @Html.Label("Telefon: ")
        @Html.Label("Lisainfo: ")
    </div>

    <div id="valuesDiv" class="valuesDiv">
        <label>@Html.DisplayFor(x => x.Name)</label>
        <label>@Html.DisplayFor(x => x.Author)</label>
        <label>@Html.DisplayFor(x => x.Faculty.Name)</label>
        <label>@Html.DisplayFor(x => x.Location)</label>
        <label>@Html.DisplayFor(x => x.DateAdded)</label>
        <label>@Html.DisplayFor(x => x.Price)</label>
        <label>@Html.DisplayFor(x => x.User.Name)</label>
        <label>@Html.DisplayFor(x => x.User.Email)</label>
        @Html.Label(Model.User.Phone ?? "-")
        @Html.TextArea("descriptionTextBox", Model.Description ?? "", new { rows = 5, @readonly = "true", placeholder = "Omanik pole siia midagi lisanud.." })
    </div>

    <div class="bookPicturesDiv">
        @foreach (var book in Model.Book_Pictures)
        {
            <a href="~/Content/Public_Images/@book.Location">
                <img src="~/Content/Public_Images/thumbs/@book.Location" alt=""/>
            </a>
        }
    </div>

    <label id="kommentaarid">Kommentaarid: </label>
    <div id="commentsDiv" class="commentsDiv">
        @Html.Action("Comments", "Comments", new { page = 1, itemId = Model.Id, typeId = 1 })
    </div>


</div>

@section AddToFooter{
    <script type="text/javascript">
        $(function () {
            $('.bookPicturesDiv a').lightBox({ fixedNavigation: true });
        });
    </script>
}
